import { mock } from "mockjs";

export default [
  {
    url: "/api/img",
    methods: "post",
    response: ({ body }) => {
      let table = {
        id: "@increment",
        name: "@cname",
        group: "@cname",
        date: "2021/8/11",
        reason: ["@cname"],
      };
      if (body.length != 0) {
        return mock({
          code: "200",
          message: "成功",
          data: table,
        });
      }
      return 1;
    },
  },
  {
    url: "/api/person",
    methods: "post",
    response: ({ body }) => {
      if (body.token != 0) {
        return {
          code: "200",
          message: "成功",
        };
      } else {
        return {
          code: "400",
          message: "失败",
        };
      }
    },
  },
];
